package com.jiashihui.schema_lgorithm.jvm;

/**
 * @ClassName ConstantTest
 * @Author Administrator
 * @Date 2019-07-27 12:32
 * @Version 1.0
 **/
public class ConstantTest {
    public static void main(String[] args) {
        String s = new String("1");
        s.intern();
        String s2 = "1";
        System.out.println(s == s2);


        String s3 = new String("1") + new String("1");
        s3.intern();
        String s4 = "11";
        System.out.println(s3 == s4);
    }
}
